﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nate_sRoguelikeGame
{
    class GameDirection
    {
        public static Point East = new Point(1, 0);
        public static Point Southeast = new Point(1, 1);
        public static Point South = new Point(0, 1);
        public static Point Southwest = new Point(-1, 1);
        public static Point West = new Point(-1, 0);
        public static Point Northwest = new Point(-1, -1);
        public static Point North = new Point(0, -1);
        public static Point Northeast = new Point(1, -1);
        public static Point Nowhere = new Point(0, 0);

        public static Point GetDirection(ConsoleKey key)
        {
            switch (key)
            {
                case ConsoleKey.NumPad4:
                    return West;
                case ConsoleKey.NumPad7:
                    return Northwest;
                case ConsoleKey.NumPad8:
                    return North;
                case ConsoleKey.NumPad9:
                    return Northeast;
                case ConsoleKey.NumPad6:
                    return East;
                case ConsoleKey.NumPad3:
                    return Southeast;
                case ConsoleKey.NumPad2:
                    return South;
                case ConsoleKey.NumPad1:
                    return Southwest;
                default:
                    return Nowhere;
            }
        }

        public static ConsoleKeyInfo PromptForDirection()
        {
            return Utilities.GetInputKey(new Point(0, 0), "Which direction?", new[]
                                                          {
                                                              ConsoleKey.NumPad4,
                                                              ConsoleKey.NumPad7,
                                                              ConsoleKey.NumPad8,
                                                              ConsoleKey.NumPad9,
                                                              ConsoleKey.NumPad6,
                                                              ConsoleKey.NumPad3,
                                                              ConsoleKey.NumPad2,
                                                              ConsoleKey.NumPad1,
                                                              ConsoleKey.NumPad5,
                                                          });

        }
    }
}
